import request from '@/utils/request'

export function roleList(data) {
  return request({
    url: '/backend/role/list',
    method: 'get',
    params: data
  })
}

export function allRoles() {
  return request({
    url: '/backend/role/all',
    method: 'get'
  })
}

export function createRole(data) {
  return request({
    url: '/backend/role/create',
    method: 'post',
    data
  })
}

export function updateRole(data) {
  return request({
    url: '/backend/role/update',
    method: 'post',
    data
  })
}

export function deleteRole(data) {
  return request({
    url: '/backend/role/delete/' + data.id,
    method: 'get'
  })
}

export function assignPermissions(data) {
  return request({
    url: '/backend/role/assign-permissions',
    method: 'post',
    data
  })
}
